/**
 * Copyright (c) 2009 blurredVision
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
 * associated documentation files (the "Software"), to deal in the Software without restriction, 
 * including without limitation the rights to use, copy, modify, merge, publish, distribute, 
 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or 
 * substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 
 * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 
 * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
#ifndef __GUI_CHECKBOX_H__
#define __GUI_CHECKBOX_H__

#pragma once

#include "Button.h"

namespace gui {

/**
 * \ingroup coreGUI
 *
 * The GUI CheckBox class.<br>
 * A Checkbox is a small box that can be checked by mouse click.<br>
 * A small text can be specified as the name of the checkbox.
 *
 * \date 03-28-2007
 *
 * \author juckel
 * \author dennis
 *
 */
class GUI_EXPORT CheckBox :
	public Button
{
public:
	/// Constructs a new CheckBox with a specified text. The box can already be checked.
	CheckBox(const std::string &text = "", bool isChecked = false);
	virtual ~CheckBox(void);

	/// Set the CheckBox to the specified value
	void setChecked(bool value);
	
	/// Indicates if the CheckBox is currently checked
	const bool isChecked() const;

	/// The draw function
	virtual void draw();

	/// Return the type of the gui element
	virtual inline const int getGUIType() const { return GUI_CHECKBOX; }

protected:
	/// Mouse functions
	virtual void onMousePressed(const MouseEvent &me);

	bool m_bChecked;		///< Indicate if the checkbox is set
};

} // namespace

#endif
